"use strict";

exports.make_realm = (opts = {}) => {
    const default_realm = {
        custom_profile_fields: [],
        custom_profile_field_types: [],
        giphy_api_key: "giphy-api-key",
        giphy_rating_options: {disabled: {id: 0, name: ""}},
        max_avatar_file_size_mib: 0,
        max_channel_folder_description_length: 0,
        max_channel_folder_name_length: 0,
        max_file_upload_size_mib: 0,
        max_icon_file_size_mib: 0,
        max_logo_file_size_mib: 0,
        max_message_length: 100,
        max_reminder_note_length: 0,
        max_stream_description_length: 0,
        max_stream_name_length: 0,
        max_topic_length: 0,
        max_bulk_new_subscription_messages: 0,
        password_min_guesses: 0,
        password_min_length: 0,
        password_max_length: 0,
        realm_allow_message_editing: false,
        realm_authentication_methods: {
            default: {
                enabled: false,
                available: false,
                unavailable_reason: "",
            },
        },
        realm_available_video_chat_providers_default: {
            disabled: {name: "", id: 0},
            jitsi_meet: {name: "", id: 0},
            zoom: undefined,
            zoom_server_to_server: undefined,
            big_blue_button: undefined,
        },
        realm_avatar_changes_disabled: false,
        realm_bot_domain: "",
        realm_can_access_all_users_group: 0,
        realm_can_add_custom_emoji_group: 0,
        realm_can_add_subscribers_group: 0,
        realm_can_create_bots_group: 0,
        realm_can_create_groups: 0,
        realm_can_create_public_channel_group: 0,
        realm_can_create_private_channel_group: 0,
        realm_can_create_web_public_channel_group: 0,
        realm_can_create_write_only_bots_group: 0,
        realm_can_delete_any_message_group: {
            direct_subgroups: [],
            direct_members: [],
        },
        realm_can_delete_own_message_group: 0,
        realm_can_invite_users_group: 0,
        realm_can_manage_all_groups: 0,
        realm_can_manage_billing_group: 0,
        realm_can_mention_many_users_group: 0,
        realm_can_move_messages_between_channels_group: 0,
        realm_can_move_messages_between_topics_group: 0,
        realm_can_resolve_topics_group: 0,
        realm_can_set_delete_message_policy_group: 0,
        realm_can_set_topics_policy_group: 0,
        realm_can_summarize_topics_group: 0,
        realm_create_multiuse_invite_group: 0,
        realm_date_created: 0,
        realm_default_code_block_language: "",
        realm_default_external_accounts: {},
        realm_default_language: "",
        realm_description: "Dummy realm",
        realm_digest_emails_enabled: false,
        realm_digest_weekday: 0,
        realm_direct_message_initiator_group: 0,
        realm_direct_message_permission_group: 0,
        realm_disallow_disposable_email_addresses: false,
        realm_domains: [],
        realm_email_auth_enabled: false,
        realm_email_changes_disabled: false,
        realm_emails_restricted_to_domains: false,
        realm_embedded_bots: [],
        realm_empty_topic_display_name: "",
        realm_enable_guest_user_dm_warning: false,
        realm_enable_guest_user_indicator: false,
        realm_enable_read_receipts: false,
        realm_enable_spectator_access: false,
        realm_giphy_rating: 0,
        realm_icon_source: "",
        realm_icon_url: "",
        realm_incoming_webhook_bots: [],
        realm_inline_image_preview: false,
        realm_inline_url_embed_preview: false,
        realm_invite_required: false,
        realm_jitsi_server_url: null,
        realm_linkifiers: [],
        realm_logo_source: "",
        realm_logo_url: "",
        realm_message_content_allowed_in_email_notifications: false,
        realm_message_content_edit_limit_seconds: null,
        realm_message_content_delete_limit_seconds: null,
        realm_message_edit_history_visibility_policy: "all",
        realm_message_retention_days: 0,
        realm_move_messages_between_streams_limit_seconds: null,
        realm_move_messages_within_stream_limit_seconds: null,
        realm_name_changes_disabled: false,
        realm_name: "",
        realm_new_stream_announcements_stream_id: 0,
        realm_night_logo_source: "",
        realm_night_logo_url: "",
        realm_org_type: 0,
        realm_password_auth_enabled: false,
        realm_plan_type: 0,
        realm_playgrounds: [],
        realm_presence_disabled: false,
        realm_push_notifications_enabled: false,
        realm_push_notifications_enabled_end_timestamp: null,
        realm_require_e2ee_push_notifications: false,
        realm_require_unique_names: false,
        realm_send_welcome_emails: false,
        realm_signup_announcements_stream_id: 0,
        realm_topics_policy: "allow_empty_topic",
        realm_upload_quota_mib: null,
        realm_url: "",
        realm_video_chat_provider: 0,
        realm_waiting_period_threshold: 0,
        realm_want_advertise_in_communities_directory: false,
        realm_welcome_message_custom_text: "",
        realm_zulip_update_announcements_stream_id: 0,
        server_avatar_changes_disabled: false,
        server_can_summarize_topics: false,
        server_emoji_data_url: "",
        server_inline_image_preview: false,
        server_inline_url_embed_preview: false,
        server_max_deactivated_realm_deletion_days: null,
        server_min_deactivated_realm_deletion_days: null,
        server_jitsi_server_url: null,
        server_name_changes_disabled: false,
        server_needs_upgrade: false,
        server_presence_offline_threshold_seconds: 0,
        server_presence_ping_interval_seconds: 0,
        server_supported_permission_settings: {
            realm: {},
            stream: {},
            group: {},
        },
        server_thumbnail_formats: [],
        server_typing_started_expiry_period_milliseconds: 0,
        server_typing_started_wait_period_milliseconds: 0,
        server_typing_stopped_wait_period_milliseconds: 0,
        server_web_public_streams_enabled: false,
        settings_send_digest_emails: false,
        stop_words: [],
        upgrade_text_for_wide_organization_logo: "",
        zulip_feature_level: 0,
        zulip_merge_base: "",
        zulip_plan_is_not_limited: false,
        zulip_version: "11",
    };
    return {
        ...default_realm,
        ...opts,
    };
};
